#include "connectivity.h"

Connectivity::Connectivity() {
    connectToBimosBox();
    dataGrabber = new DataGrabber(handle);
    dataGrabber->setInterval(30);
    dataGrabber->start();
    qDebug() << "timeHandle started";
}



void Connectivity::connectToBimosBox() {

    handle = DapiOpenModule(RO_ETH,0);

    if (DapiGetLastError() != 0) {
        char msg[500];
        DapiGetLastErrorText((unsigned char*) msg, sizeof(msg));
        qDebug() << "Connection could not be established! Error: " << QString::fromLocal8Bit(msg);
        return;
    }

    qDebug() << "Module handle = " << handle;

}




